import redis

class Config(object):

    DEBUGE = True
    SQLALCHEMY_DATABASE_URI='mysql://root:mysql@127.0.0.1:3306/information_10'
    SQLALCHEMY_TRACK_MODIFICATIONS=True
    #redis配置
    redis_host='127.0.0.1'
    redis_port=6379
    #配置密钥
    SECRET_KEY='KFJAKFNKAHRTIJNZH+/addkhjijkkaadad'

    #session配置
    SESSION_TYPE='redis'    #指定存到redis
    SESSION_REDIS=redis.StrictRedis(host=redis_host,port=redis_port)#创建redis对象,用于储存短信验证码
    SESSION_USE_SIGNER=True     #让cookie中的session 被签名加密处理
    PERMANET_SESSION_LIFETIME=86400     #过期时间，可以随意设置


class DevelopementConfig(Config):
    DEBUGE = True



class ProdutionConfig(Config):
    DEBUGE = False



config_map = {
    'developement':DevelopementConfig,
    'prodution':ProdutionConfig
}